const fs = require('fs')
let configPath = './config.development.js';
let config = require(fs.existsSync(configPath) ? configPath : './config.js');
let nm = require('./source')
//实体
nm.$.merge(config,require('./entity'))
//初始化
nm.init(config)
require('./source/init.js')(nm.models(), {
	id:'ybdv',
	java:{
		id:'com.ybdv',///应用ID
		datbase:'ybdv'///数据库名称
	},
	name:'ybdv',
	menus:[//初始化时超管后台菜单
		{name:'首页',url:'/pages/index/index'},
		{name:'系统设置',children:[
			{name:'权限管理',url:'/pages/group/list/list'},
			{name:'菜单管理',url:'/pages/menu/list/list'},
			{name:'用户管理',url:'/pages/user/list/list'},
			{name:'项目管理',url:'/pages/unit/list/list'},
			{name:'操作日志',url:'/pages/userActionRecord/list'}
		]},
		{name:'数据源管理',url:'/pages/data/source'},
		{name:'项目管理',url:'/pages/unit/list/list'},
		{name:'模块管理',url:'/pages/pject/pject'},
		{name:'视图管理',url:'/pages/data/view'},
		{name:'数据集管理',url:'/pages/data/set'},
		{name:'任务管理',url:'/pages/job/job'}
	]
},async models => {
	await models.user.updateSync({userName:'admin'},{ passWord:nm.$.MD5('datax@1124') })
})